
#include "ScenePropertiesView.h"


ScenePropertiesView::ScenePropertiesView(QWidget *parent)
    : QTableWidget(parent)
{

}

ScenePropertiesView::~ScenePropertiesView()
{

}

void ScenePropertiesView::onImageInserted(ImageInfo *info, QGraphicsPixmapItem *pitem, int mode)
{
    QTableWidgetItem *item = 0;

    int row = rowCount();
    setRowCount(row+1);

    // name
    item = new QTableWidgetItem(info->name());
    item->setTextAlignment(Qt::AlignHCenter);
    setItem(row, 0, item);

    // mode
    if (ImageBkgnd == mode)
    {
        item = new QTableWidgetItem("Background");
    }
    else if (ImageMask == mode)
    {
        item = new QTableWidgetItem("Mask");
    }
    item->setTextAlignment(Qt::AlignHCenter);
    setItem(row, 1, item);

    // position
    setCellWidget(row, 2, new QTextEdit());
}

void ScenePropertiesView::onImageDeleted(int index, qint64 cacheKey)
{

}

void ScenePropertiesView::onImagePositionAdjusted(int index, qint64 cacheKey, const QPoint &pos)
{

}

void ScenePropertiesView::onImageModeModified(int index, qint64 cacheKey, int mode)
{

}

void ScenePropertiesView::onImageOrderSwaped(int srcIdx, int dstIdx, qint64 srcKey, qint64 dstKey)
{

}
